﻿using System.Windows.Automation;
using ProdControls.Interfaces;
using ProdControls.UIAPatterns;

namespace ProdControls.Bridges
{
    /// <summary>
    ///   Handles non-list related items that use the SelectionPatterns
    /// </summary>
    internal static class SelectionBridge
    {
        /// <summary>
        ///   Gets a value that specifies whether the container allows more than one child element to be selected concurrently.
        /// </summary>
        /// <value> <c>true</c> if this instance can select multiple; otherwise, <c>false</c> . </value>
        public static bool CanSelectMultipleHook(this ISelection extension, BaseProdControl control)
        {
            return SelectionPatternHelper.CanSelectMultiple(control.UiaElement);
        }

        /// <summary>
        ///   Gets a value that specifies whether the container requires at least one child item to be selected.
        /// </summary>
        /// <value> <c>true</c> if this instance is selection required; otherwise, <c>false</c> . </value>
        public static bool IsSelectionRequiredHook(this ISelection extension, BaseProdControl control)
        {
            return SelectionPatternHelper.IsSelectionRequired(control.UiaElement);
        }


    }
}